struct HuffmanNode {
    char ch;
    int freq;
    HuffmanNode* left;
    HuffmanNode* right;
    
    HuffmanNode(char c = '\0', int f = 0) : ch(c), freq(f), left(nullptr), right(nullptr) {}
    
    // 为了使用优先队列（最小堆）
    bool operator>(const HuffmanNode& other) const {
        return freq > other.freq;
    }
};